<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:include="public/page_css::page_css ('取消收货')" />

<body>
<div class="layui-fluid larry-wrapper">
    <div class="layui-row layui-col-space30">
        <div class="layui-col-xs24">
            <section class="panel panel-padding">
                <form id="form1" class="layui-form layui-form-pane" action="">
                    <div>&nbsp;</div>
                    <input type="hidden" name="id">
                    <div class="layui-form-item">
                        <label class="layui-form-label">取消人员</label>
                        <div class="layui-input-block">
                            <input type="text" name="qxry" id="qxry" placeholder="取消人员" lay-verify="required" autocomplete="off" class="layui-input "/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">取消原因</label>
                        <div class="layui-input-block">
                            <input type="text" name="qxyy" id="qxyy" placeholder="取消原因" lay-verify="required" autocomplete="off" class="layui-input "/>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" jq-filter="submit" lay-submit="" lay-filter="editKq">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                    <input type="hidden" name="ids" th:value="${id}" id="kid">
                </form>
            </section>
        </div>
    </div>
</div>
</body>
<div th:include="public/public_js::public_js"></div>

<script th:inline="javascript">
    $(function () {

    })
    function editSelect2(dom,value){

    }
</script>
<script>
    layui.use(['myform','zzpUtils','form','jquery'],function () {
        var form = layui.form,
            zzpUtils = layui.zzpUtils,
            $ = layui.jquery;
        var ids = [];
        var id=$("#kid").val();
        var qxry=$('#qxry').val();
        var qxyy=$('#qxyy').val();
        ids.push(id);
        form.on("submit(editKq)",function(data){
            console.log(zzpUtils.getFormJson($("#form1")));
                zzpUtils.action({
                    url:"/wmsreceiving/rollBackASNReceiving",
                    data:JSON.stringify({ids:ids,qxry:qxry,qxyy:qxyy}),
                    success:function (data) {
                        setTimeout(function(){
                            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                            parent.layer.close(index); //再执行关闭
                            top.layer.msg(data.title);
                        },500);
                    },error: function (xhr, textStatus) {
                        console.log(textStatus);
                        console.log(xhr)
                    }
                })

                /*zzpUtils.action({
                    url: "/wmsreceiving/rollBackASNReceiving" ,
                    data: JSON.stringify({ids:ids,qxry:qxry,qxyy:qxyy}),
                    success: function (data) {
                        setTimeout(function () {
                            layer.msg(data.title);
                            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                            parent.layer.close(index); //再执行关闭
                            top.layer.msg(data.title);
                        }, 500);
                        zzpUtils.refreshTable("#table");
                    }, error: function (xhr, textStatus) {
                        console.log(textStatus);
                        console.log(xhr)
                    }
                })*/

            return false;
        });
    });
</script>
</html>